package call_handler;

public enum Rank {
    RESPONDER (0),
	MANAGER (1),
	DIRECTOR (2);

    public static final int TOTAL_LEVELS = 3;
    private int value;

    /**
     * GQ
     * Illegal modifier. Only private is allowed for enum constructor.
     */
//    public Rank(int v) {
    private Rank(int v) {
	this.value = v;
    }

    public int getValue() {
	return value;
    }

    public String toString() {
	switch(value) {
	case 0:
	    return "Responder";
	case 1:
	    return "Manager";
	case 2:
	    return "Director";
	default:
	    return "Error. We are sorry for any inconvenience.";
		}
    }

    public static Rank getRankFromLevel(int value) {
	switch(value) {
	case 0:
	    return Rank.RESPONDER;
	case 1:
	    return Rank.MANAGER;
	case 2:
	    return Rank.DIRECTOR;
	default:
	    return null;
	}
    }
   
    public Rank increasingRank() {
	switch(value) {
	case 0:
		value = 1;
	    return Rank.MANAGER;
	case 1:
		value = 2;
	    return Rank.DIRECTOR;
	default:
		value = 2;
	    return Rank.DIRECTOR;
	}
    }
}